package com.wqc;

import com.wqc.tx.User;
import com.wqc.tx.UserService;
import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class TxTest {

    public static void main(String[] args) throws Exception{

        System.getProperties().put("sun.misc.ProxyGenerator.saveGeneratedFiles","true");

        ApplicationContext context = new ClassPathXmlApplicationContext("spring/txApplicationContext.xml");
        UserService userService = (UserService)context.getBean("userService");
        User user = new User();
        user.setName("张三");
        user.setAge(12);
        user.setSex("男");
        userService.save(user);
    }

}
